package com.seecoder.BlueWhale.vo;

import com.seecoder.BlueWhale.enums.CouponGroupStatusEnum;
import com.seecoder.BlueWhale.enums.CouponTypeEnum;
import com.seecoder.BlueWhale.enums.CouponScopeEnum;
import com.seecoder.BlueWhale.enums.UserStatusEnum;
import com.seecoder.BlueWhale.po.CouponGroup;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class CouponGroupVO {
    private int id;

    //优惠券总数（创建后不变）
    private int couponCount;

    //优惠券作用域, 0表示全局GLOBAL，1表示局部LOCAL
    private CouponScopeEnum couponScope;

    //优惠券类型，0表示满减券FULL_REDUCTION，1表示蓝鲸券SPECIAL
    private CouponTypeEnum couponType;

    //优惠券组状态，0表示还有剩余REMAINING，1表示已领完NOT_REMAINING
    private CouponGroupStatusEnum couponGroupStatus;

    //用户领取状态，0表示已领取RECEIVED，1表示未领取NOT_RECEIVED
    private UserStatusEnum userStatus;
    private int storeId;
    private double fullAmount;
    private double discountAmount;

    //已领取的的数量，用户每次领取，加一
    private int receivedCount;

    public CouponGroup toPO() {
        CouponGroup couponGroup = new CouponGroup();
        couponGroup.setId(this.id);
        couponGroup.setCouponCount(this.couponCount);
        couponGroup.setCouponScope(this.couponScope);
        couponGroup.setCouponType(this.couponType);
        couponGroup.setStoreId(this.storeId);
        couponGroup.setFullAmount(this.fullAmount);
        couponGroup.setDiscountAmount(this.discountAmount);
        couponGroup.setReceivedCount(this.receivedCount);
        return couponGroup;
    }
}
